package com.sunxu.exercise7;

/**
 * ${DESCRIPTION}
 *
 * @author Sun
 * @create 2017-08-02-16:08
 */
public class ThreadA extends Thread {

    private Object lock;

    public ThreadA(Object lock) {
        this.lock = lock;
    }

    @Override
    public void run() {
        try {
            synchronized (lock) {
                System.out.println("开始  wait time=" + System.currentTimeMillis());
                lock.wait();
                System.out.println("结束  wait time= " + System.currentTimeMillis());
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
